<cfsetting requesttimeout="60">

<!--- <link rel="stylesheet" href="//www.google.com/cse/style/look/default.css" type="text/css" />
<script id="jqueryui" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js" defer async></script>
<script src="//www.google.com/jsapi?key=AIzaSyCMjPkFCRWVdZ5HlAlc8tp_v8gike4HzxI"></script>
<script src="//maps.google.com/maps?file=api&v=2&key=AIzaSyCMjPkFCRWVdZ5HlAlc8tp_v8gike4HzxI" type="text/javascript"></script> --->

<cfparam name="Workshop_ID" type="numeric" default="0" />
<cfparam name="Organizer_ID" type="numeric" default="0" />
<cfparam name="Manager_ID" type="numeric" default="0" />
<cfparam name="Site_ID" type="numeric" default="0" />
<cfparam name="Organization_ID" type="numeric" default="0" />
<cfparam name="Zip_Code_ID" type="string" default="0" />
<cfparam name="City_ID" type="string" default="0" />
<cfparam name="County_ID" type="numeric" default="0" />
<cfparam name="Region_ID" type="numeric" default="0" />
<cfparam name="District_ID" type="numeric" default="0" />
<cfparam name="School_ID" type="numeric" default="0" />
<cfparam name="rollupLevel" type="string" default="workshop" />
<cfscript>
	if (Workshop_ID gt 0) {
		workshopGateway = new assets.calgrants.com.gateway.WorkshopGateway();
		qWorkshop = workshopGateway.query(Workshop_ID = Workshop_ID);
		workshop = workshopGateway.get(Workshop_ID = Workshop_ID);
		// do not need organizer or manager for report
		siteGateway = new assets.calgrants.com.gateway.SiteGateway();
		qSite = siteGateway.query(Site_ID = workshop.getSite_ID());
		//site = siteGateway.get(Site_ID = workshop.getSite_ID());
		siteWorkshops = workshopGateway.query(Site_ID = workshop.getSite_ID(), Deleted = 0, Approved = 1);
		organizationGateway = new assets.calgrants.com.gateway.OrganizationGateway();
		qOrganization = organizationGateway.query(Organization_ID = workshop.getOrganization_ID());
		//organization = organizationGateway.get(Organization_ID = workshop.getOrganization_ID());
		countyGateway = new assets.calgrants.com.gateway.CountyGateway();
		qCounty = countyGateway.query(County_ID = qSite.County_ID);
		//county = countyGateway.get(County_ID = site.getCounty_ID());
	} else if (Organizer_ID gt 0) {
		
	} else if (Manager_ID gt 0) {
		
	} else if (Site_ID gt 0) {
		
	} else if (Organization_ID gt 0) {
		
	} else if (Zip_Code_ID gt 0) {
		
	} else if (City_ID gt 0) {
		
	} else if (County_ID gt 0) {
		
	} else if (Region_ID gt 0) {
		
	} else if (District_ID gt 0) {
		
	} else if (School_ID gt 0) {
		
	} else {
		
	}
	evaluationGateway = new assets.calgrants.com.gateway.EvaluationGateway();
	baseData = evaluationGateway.report(workshopIDs = workshop.getWorkshop_ID());
	//trendEvaluations = evaluationGateway.report(siteIDs = workshop.getSite_ID());
</cfscript>

<cfif Workshop_ID gt 0>
	<cfset trendData = StructNew() />
	<cfset eQuestions = "1,7,11,12" />
	
	<cfquery name="getProgramYears" dbtype="query">
		select distinct Program_Year from siteWorkshops order by Program_Year
	</cfquery>
	<cfset programYears = ValueList(getProgramYears.Program_Year) />
	
	<cfif ListLen(programYears) gt 1>	
		<cfloop index="py" list="#programYears#">
			<cfset e = evaluationGateway.report(siteIDs = workshop.getSite_ID(), programYear = py) />
			<cfloop index="q" list="#eQuestions#">
				<cfif NOT StructKeyExists(trendData, q)>
					<cfset trendData[q] = StructNew()>
				</cfif>
				<cfloop index="a" from="1" to="#ArrayLen(e[q].Answers)#">
					<cfset an = e[q].Answers[a].Answer />
					<cfif NOT StructKeyExists(trendData[q], e[q].Answers[a].Answer)>
						<cfset trendData[q][an] = ArrayNew(1) />
					</cfif>
					<cfset ArrayAppend(trendData[q][an], e[q].Answers[a].Response_Percent) />
				</cfloop>
			</cfloop>
		</cfloop>
	</cfif>
</cfif>

<style type="text/css">
	h4.sideLabel {
		font-family:"Tw Cen MT", Arial, Helvetica;
		font-size: 14px;
		margin-bottom: 0;
	}
	p.sideText {
		font-family: "Tw Cen MT Condensed", Arial, Helvetica;
		font-size: 28px;
		margin-bottom: 15px;
	}
	h3.sideHeader {
		font-family: "Tw Cen MT Condensed", Arial, Helvetica;
		font-size: 42px;
	}
	h2 {
		font-family: "Tw Cen MT Condensed", Arial, Helvetica;
		font-size: 42px;
	}
	.col1 {
		background-color: #55b4d0;
		padding: 10px;
	}
	.aquaMuted {color: #aad9e7;}
	
	.aqua {color: #55b4d0;}
	.aquaDark {color: #2682d6;}
	
	.blue {color: #2682d6;}
	.blueDark {color: #0f2a88;}
	
	.green {color: #5dba5d;}
	.greenDark {color: #417630;}
	
	.greyDark {color: #444444;}
	.greyLight {color: #aaa89a;}
	.white {color: #fff;}
	
	/*.icon-male, .icon-female {font-size: 2.6em;}
	.icon-male {color: #aad9e7; margin: 0 2.5px;}
	.icon-male.highlighted {color: #2682d6;}
	.icon-female {color: #aad9e7;}
	.icon-female.highlighted {color: #0f2a88;}*/
	#genderTable tr.topRow td {height: 54px; font-size: 0.8em; text-align: center; vertical-align: middle;}
	#genderTable tr.bottomRow td {height: 54px; font-size: 0.8em; font-weight: bold; text-align: center; vertical-align: middle;}
	#genderTable tr.girls td {height: 60px; text-align: center;}
	#genderTable tr.boys td {height: 60px; text-align: center;}
	#genderTable table td.genderTeardrop {font-size: 1.2em; color: #fff;}
	#femaleCount, #maleCount, #genderCount {width: 38px;}
</style>

<script type="application/javascript">
<!--
	<cfoutput>
		var programYears = [#QuotedValueList(getProgramYears.Program_Year)#];
		var baseData = #SerializeJSON(baseData)#;
		var trendData = #SerializeJSON(trendData)#;
		var questions = #SerializeJSON(baseData)#;
	</cfoutput>
	
	var donutLabelTemplate = "#= dataItem.RESPONSE_PERCENT#%";
	var donutLegendTemplate = "#= dataItem.ANSWER#";
	
	var pieLabelTemplate = "#= dataItem.ANSWER# - #= dataItem.RESPONSE_PERCENT#%";
	var pieLegendTemplate = "#= dataItem.ANSWER# - #= dataItem.RESPONSE_PERCENT#%";
	//var pieTooltipTemplate = "#= dataItem.ANSWER# - #= dataItem.RESPONSE_COUNT#";
	var pieTooltipTemplate = "#= dataItem.RESPONSE_COUNT# responses = #= dataItem.RESPONSE_PERCENT#%";
	var barLabelTemplate = "#= dataItem.ANSWER# - #= dataItem.RESPONSE_PERCENT#%";
	var barLegendTemplate = "#= text#";
	var barTooltipTemplate = "#= dataItem.RESPONSE_COUNT# responses = #= dataItem.RESPONSE_PERCENT#%";
	var donutLabelFont = "24px 'Tw Cen MT', Arial, Helvetica bold";
	var labelFont = "12px Arial,Helvetical,sans-serif";
	var legendFont = "12px Arial,Helvetical,sans-serif";
	var tooltipFont = "12px Arial,Helvetical,sans-serif";
	var d = [
		{name: "Excellent", data: [80, null, 85, 90]},
		{name: "Good", data: [15, null, 10, 5]},
		{name: "Fair", data: [3, null, 3, 3]},
		{name: "Poor", data: [2, null, 2, 2]}
	];
	
	getSeriesData = function(q) {
		var d = trendData[q];
		var r = [];
		for (var k in d) {
			var s = {};
			s["name"] = k;
			s["data"] = d[k];
			r.push(s);	
		}
		return r;
	}
	
	putGenderCounts = function() {
		$("#femaleCount").text("234");
		$("#maleCount").text("123");
		$("#genderCount").text("357");
	}
	// use as theme: 'newTheme'
	kendo.dataviz.ui.registerTheme("hdwd", {
		"chart": {
			"title": {
				"color": "#000000"
			},
			"legend": {
				"labels": {
					"color": "#aaa89a"
				}
			},
			"chartArea": {
				"background": "rgba(0, 0, 0, 0)"
			},
			"seriesDefaults": {
				"labels": {
					"color": "#aaa89a"
				}
			},
			"axisDefaults": {
				"line": {
					"color": "#aaa89a"
				},
				"labels": {
					"color": "#aaa89a"
				},
				"minorGridLines": {
					"color": "#aaa89a"
				},
				"majorGridLines": {
					"color": "#aaa89a"
				},
				"title": {
					"color": "#aaa89a"
				}
			},
			"seriesColors": [
				"#1a307b",
				"#5bb65e",
				"#2682d6",
				"#55b4d0",
				"#417630",
				"#444444"
			],
			"tooltip": {}
		},
		/*"gauge": {
			"pointer": {
				"color": "#10c4b2"
			},
			"scale": {
				"rangePlaceholderColor": "#cdcdcd",
				"labels": {
					"color": "#4c5356"
				},
				"minorTicks": {
					"color": "#4c5356"
				},
				"majorTicks": {
					"color": "#4c5356"
				},
				"line": {
					"color": "#4c5356"
				}
			}
		}*/
	});
	colors = ["#55b4d0","#2682d6","#5dba5d","#aaa89a","#2682d6","#0f2a88","#417630","#444444"];
	parseQuestions = function(questions) {
		for (var q = 0; q < questions.length; q++) {
			questions[q].QUESTION_NUMBER = parseInt(questions[q].QUESTION_NUMBER);
			questions[q].RESPONSE_COUNT = parseInt(questions[q].RESPONSE_COUNT);
			questions[q].MULTI_RESPONSE_COUNT = parseInt(questions[q].MULTI_RESPONSE_COUNT);
			questions[q].NO_RESPONSE_COUNT = parseInt(questions[q].NO_RESPONSE_COUNT);
		}
		return questions;
	}
	parseAnswers = function(answers) {
		for (var a = 0; a < answers.length; a++) {
			if (answers[a].ANSWER === true) {
				answers[a].ANSWER = "Yes ";
			} else if (answers[a].ANSWER === false) {
				answers[a].ANSWER = "No ";
			}
			answers[a].ANSWER_NUMBER = parseInt(answers[a].ANSWER_NUMBER);
			answers[a].RESPONSE_COUNT = parseInt(answers[a].RESPONSE_COUNT);
			answers[a].RESPONSE_PERCENT = parseFloat(answers[a].RESPONSE_PERCENT);
			//answers[a].RESPONSE_OTHER = answers[a].ANSWER_VALUES.toString();
			answers[a].EXPLODE = false;
		}
		return answers;
	}
	renderPieChart = function(q) {
		var question = questions[q-1];
		var answers = parseAnswers(question.ANSWERS);
		$("#q" + q + "Chart").kendoChart({
			theme: $(document).data("kendoSkin") || "metro",
			dataSource: answers,
			series: [{
				type: "pie",
				field: "RESPONSE_PERCENT",
				categoryField: "ANSWER",
				explodeField: "EXPLODE",
				labels: {
					visible: true,
					align: "circle",
					font: labelFont,
					template: pieLabelTemplate,
					distance: 20
				},
				padding: 50
			}],
			legend: {
				visible: false,
				position: "left",
				labels: {
					font: legendFont,
					template: pieLegendTemplate
				}
			},
			tooltip: {
				visible: true,
				font: tooltipFont,
				template: pieTooltipTemplate
			}
		})
	}
	
	renderDonutChart = function(q) {
		var question = questions[q-1];
		var answers = parseAnswers(question.ANSWERS);
		$("#q" + q + "Chart").kendoChart({
			//theme: $(document).data("kendoSkin") || "CSAC",
			dataSource: answers,
			series: [{
				type: "donut",
				//color: colors[0],
				field: "RESPONSE_PERCENT",
				categoryField: "ANSWER",
				explodeField: "EXPLODE",
				overlay: {gradient: "none"},
				startAngle: 0,
				labels: {
					align: "circle",
					background: "#fff",
					color: "#000",
					distance: 20,
					padding: 0,
					margin: 0,
					font: donutLabelFont,
					position: "outsideEnd",
					template: donutLabelTemplate,
					visible: true
				},
				border: {width: 2, color: "#fff"}
			}],
			chartArea: {
				height: 250
			},
			seriesColors: ["#55b4d0","#2682d6","#5dba5d","#aaa89a","#2682d6","#0f2a88","#417630","#444444"],
			legend: {
				visible: false,
				position: "right",
				labels: {
					font: donutLabelFont,
					template: donutLegendTemplate
				}
			},
			tooltip: {
				visible: false,
				font: tooltipFont,
				template: pieTooltipTemplate
			}
		})
	}
	
	renderLineChart = function(q) {
		$("#q" + q + "LineChart").kendoChart({
			legend: {visible: false},
			seriesDefaults: {type: "line"},
			series: getSeriesData(q),
			seriesColors: colors,
			chartArea: {
				height: 250,
				width: 400
			},
			valueAxis: {
				labels: {format: "{0}%"},
				line: {visible: false}, 
				majorUnit: 25,
				minorUnit: 12.5,
				majorGridLines: {visible: true, width: 1, dashType: "dot"},
				minorGridLines: {visible: true, width: 1, dashType: "dot"}
			},
			categoryAxis: {
				categories: programYears,
				line: {visible: false},
				majorGridLines: {visible: false},
				minorGridLines: {visible: false}	
			}
		})
	}
	
	renderAreaChart = function(q) {
		$("#q" + q + "AreaChart").kendoChart({
			legend: {visible: false},
			seriesDefaults: {type: "area"},
			series: getSeriesData(q),
			chartArea: {
				height: 250,
				width: 400
			},
			seriesColors: colors,
			valueAxis: {
				labels: {format: "{0}%"},
				line: {visible: false}	
			},
			categoryAxis: {
				categories: programYears,
				majorGridlines: {visible: false}	
			}
		})
	}
	
	renderTrendAreaChart = function(q) {
		$("#q11TrendAreaChart").kendoChart({
			legend: {visible: false},
			seriesDefaults: {type: "area"},
			series: [
				{name: "Excellent", data: [80, null, 85, 90]},
				{name: "Good", data: [15, null, 10, 5]},
				{name: "Fair", data: [3, null, 3, 3]},
				{name: "Poor", data: [2, null, 2, 2]}
			],
			chartArea: {
				height: 250,
				width: 400
			},
			seriesColors: ["#55b4d0","#2682d6","#5dba5d","#aaa89a","#2682d6","#0f2a88","#417630","#444444"],
			valueAxis: {
				labels: {format: "{0}%"},
				line: {visible: false}	
			},
			categoryAxis: {
				categories: programYears,
				majorGridlines: {visible: false}	
			}
		})
	}
	
	getChartImage = function(q) {
		var chart = $("#q11Chart").data("kendoChart");
		var img = chart.imageDataURL();
		console.log(img);
		//document.location.href = img;
	}
	
	renderBarChart = function(q) {
		var question = questions[q-1];
		var answers = parseAnswers(question.ANSWERS);
		$("#q" + q + "Chart").kendoChart({
			//theme: $(document).data("kendoSkin") || "metro",
			dataSource: answers,
			plotArea: {
				margin: {
					right: 200
				}
			},
			series: [{
				type: "bar",
				field: "RESPONSE_PERCENT",
				categoryField: "ANSWER",
				labels: {visible: true, font: labelFont, template: barLabelTemplate, position: "outsideEnd"},
				missingValue: "zero",
				gap: 0.4,
				spacing: 0.2,
				markers: {visible: true, border: {width: 2, size: 6}},
				padding: 50
			}],
			valueAxis: {
				title: {visible: false, text: "valueAxis"},
				labels: {template: "#= value#%"},
				majorGridLines: {visible: true, color: "gray"},
				majorTicks: {visible: true, color: "gray"},
				minorGridLines: {visible: false, color: "silver"},
				minorTicks: {visible: false, color: "silver"},
				plotBands: [{
					from: 49,
					to: 51,
					color: "gray",
					opacity: 0.3
				}]
			},
			categoryAxis: {
				title: {visible: false, text: "categoryAxis"},
				majorGridLines: {visible: false},
				majorTicks: {visible: false}
			},
			legend: {
				visible: false,
				position: "left",
				labels: {font: legendFont, template: barLegendTemplate}
			},
			tooltip: {
				visible: true,
				font: tooltipFont,
				template: barTooltipTemplate
			}
		})
	}

	$(function() {
		/*var pieCharts = "1,2,3,4,5,7,10,11,13,15,17,19";
		var barCharts = "6,9,12,14,16,18";
		var pieChartsArray = pieCharts.split(",");
		var barChartsArray = barCharts.split(",");
		if (pieChartsArray.length > 0) {
			for (var q = 0; q < pieChartsArray.length; q++) {
				renderPieChart(pieChartsArray[q]);
			}
		}
		if (barChartsArray.length > 0) {
			for (var q = 0; q < barChartsArray.length; q++) {
				renderBarChart(barChartsArray[q]);
			}
		}*/
		//renderDonutChart(1);
		//renderLineChart(1);
		//renderDonutChart(11);
		//renderAreaChart(11);
		//renderDonutChart(7);
		//renderDonutChart(12);
		putGenderCounts();
	})
//-->
</script>

<cfoutput>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span2 col1">
				Cash for College
				<h3 class="sideHeader white">HOW DID<br />
				WE DO<br />
				IN 2013?</h3>
				
				<hr />
				
				<h4 class="sideLabel greyDark">Site Name</h4>
				<p class="sideText white">#qSite.Site#</p>
				<h4 class="sideLabel greyDark">City</h4>
				<p class="sideText white">#qSite.City#</p>
				<h4 class="sideLabel greyDark">County</h4>
				<p class="sideText white">#qSite.County#</p>
				<h4 class="sideLabel greyDark">Region</h4>
				<p class="sideText white">#qSite.Region#</p>
				<h4 class="sideLabel greyDark">Site Type</h4>
				<p class="sideText white">#qSite.Site_Type#</p>
				<!--- <h4 class="sideLabel greyDark">Senior Enrollment</h4>
				<p class="sideText white">0,000</p> --->
				<h4 class="sideLabel greyDark">Site Since</h4>
				<p class="sideText white">#qSite.Initial_Program_Year#</p>
				<h4 class="sideLabel greyDark">Computer Based Workshop</h4>
				<p class="sideText white">#YesNoFormat(workshop.getOnline())#</p>
				<cfif IsDefined("organization")>
					<h4 class="sideLabel greyDark">Lead Organization</h4>
					<p>#qOrganization.Organization#</p>
				</cfif>
				<h4 class="sideLabel greyDark">Organization Since</h4>
				<p class="sideText white">#qOrganization.Initial_Program_Year#</p>
				<h4 class="sideLabel greyDark">Workshop Qualified to Offer Cash for College Scholarship?</h4>
				<p class="sideText white">??Nes??</p>
				<h4 class="sideLabel greyDark">Follow-Up Requests</h4>
				<cfset followUpRequestPct = qWorkshop.Follow_Up_Request_Count / qWorkshop.Student_Count * 100 />
				<p class="sideText white">#qWorkshop.Follow_Up_Request_Count# (#Int(followUpRequestPct)#%)</p>
				<cfif qWorkshop.Follow_Up_Request_Count gt 0>
					<h4 class="sideLabel greyDark">Used Follow-Up Platform?</h4>
					<p class="sideText white"><cfif qWorkshop.Complete_Follow_Up_Request_Count gt 0>Yes (#qWorkshop.Complete_Follow_Up_Request_Count#)<cfelse>No</cfif></p>
				</cfif>
			</div>
			<div class="span5">
				<h2>WORKSHOP RATING</h2>
				<div class="row-fluid">
					<div class="span6">
						<div id="q1Chart"></div>
					</div>
					<div class="span6">
						<div id="q1LineChart"></div>
					</div>
				</div>
				<h2>ATTENDANCE by GENDER</h2>
				<div class="row-fluid">
					<div class="span12">
						<div class="row-fluid">
							<div class="span12">
								<table id="genderTable" border="1" cellpadding="4" cellspacing="0">
									<tr class="topRow">
										<td colspan="4"></td>
										<td id="femaleCount" colspan="2" style="background-image: url('/assets/calgrants/ui/images/hdwd/green-marker-down.png'); background-repeat: no-repeat; background-position: center;">123</td>
										<td colspan="5"></td>
										<!--- <td rowspan="4">
											<table border="1" cellpadding="0" cellspacing="0" height="130" width="66">
												<tr>
													<td valign="top" class="genderTeardrop" style="background-image: url('/assets/calgrants/ui/images/hdwd/female-tearpanel.png'); background-repeat: no-repeat; background-position: top;">54%</td>
													<td valign="bottom" class="genderTeardrop" style="background-image: url('/assets/calgrants/ui/images/hdwd/male-tearpanel.png'); background-repeat: no-repeat; background-position: bottom;">46%</td>
												</tr>
											</table>
										</td> --->
									</tr>
									<tr class="girls">
										<td><img src="/assets/calgrants/ui/images/hdwd/female-green.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/female-green.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/female-green.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/female-green.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/female-green.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/female-default.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/female-default.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/female-default.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/female-default.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/female-default.png" /></td>
										<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
									</tr>
								<!--- </table> --->
								<!--- <img src="/assets/calgrants/ui/images/hdwd/female-green.png" />
								<img src="/assets/calgrants/ui/images/hdwd/female-green.png" />
								<img src="/assets/calgrants/ui/images/hdwd/female-green.png" />
								<img src="/assets/calgrants/ui/images/hdwd/female-green.png" />
								<img src="/assets/calgrants/ui/images/hdwd/female-green.png" />
								<img src="/assets/calgrants/ui/images/hdwd/female-default.png" />
								<img src="/assets/calgrants/ui/images/hdwd/female-default.png" />
								<img src="/assets/calgrants/ui/images/hdwd/female-default.png" />
								<img src="/assets/calgrants/ui/images/hdwd/female-default.png" />
								<img src="/assets/calgrants/ui/images/hdwd/female-default.png" /> --->
							<!--- </div> --->
							<!--- <span class="icon-female highlighted"></span>
							<span class="icon-female highlighted"></span>
							<span class="icon-female highlighted"></span>
							<span class="icon-female highlighted"></span>
							<span class="icon-female highlighted"></span>
							<span class="icon-female"></span>
							<span class="icon-female"></span>
							<span class="icon-female"></span>
							<span class="icon-female"></span>
							<span class="icon-female"></span> --->
							<!--- <div class="span1"><span class="icon-female highlighted"></span></div>
							<div class="span1"><span class="icon-female highlighted"></span></div>
							<div class="span1"><span class="icon-female highlighted"></span></div>
							<div class="span1"><span class="icon-female"></span></div>
							<div class="span1"><span class="icon-female"></span></div>
							<div class="span1"><span class="icon-female"></span></div>
							<div class="span1"><span class="icon-female"></span></div>
							<div class="span2"></div> --->
						<!--- </div>
						<div class="row-fluid">
							<div class="span12">
								<table> --->
									<tr class="boys">
										<td><img src="/assets/calgrants/ui/images/hdwd/male-blue.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/male-blue.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/male-blue.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/male-blue.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/male-blue.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/male-default.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/male-default.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/male-default.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/male-default.png" /></td>
										<td><img src="/assets/calgrants/ui/images/hdwd/male-default.png" /></td>
										<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
									</tr>
									<tr class="bottomRow">
										<td colspan="4"></td>
										<td id="maleCount" colspan="2" style="background-image: url('/assets/calgrants/ui/images/hdwd/blue-marker-up.png'); background-repeat: no-repeat; background-position: center;"></td>
										<td colspan="3"></td>
										<td id="genderCount" colspan="2" style="background-image: url('/assets/calgrants/ui/images/hdwd/default-marker-up.png'); background-repeat: no-repeat; background-position: center;"></td>
									</tr>
								</table>
								<!--- <img src="/assets/calgrants/ui/images/hdwd/male-blue.png" />
								<img src="/assets/calgrants/ui/images/hdwd/male-blue.png" />
								<img src="/assets/calgrants/ui/images/hdwd/male-blue.png" />
								<img src="/assets/calgrants/ui/images/hdwd/male-blue.png" />
								<img src="/assets/calgrants/ui/images/hdwd/male-blue.png" />
								<img src="/assets/calgrants/ui/images/hdwd/male-default.png" />
								<img src="/assets/calgrants/ui/images/hdwd/male-default.png" />
								<img src="/assets/calgrants/ui/images/hdwd/male-default.png" />
								<img src="/assets/calgrants/ui/images/hdwd/male-default.png" />
								<img src="/assets/calgrants/ui/images/hdwd/male-default.png" /> --->
							</div>
							<!--- <div class="span1"><span class="icon-male highlighted"></span></div>
							<div class="span1"><span class="icon-male highlighted"></span></div>
							<div class="span1"><span class="icon-male highlighted"></span></div>
							<div class="span1"><span class="icon-male highlighted"></span></div>
							<div class="span1"><span class="icon-male highlighted"></span></div>
							<div class="span1"><span class="icon-male"></span></div>
							<div class="span1"><span class="icon-male"></span></div>
							<div class="span1"><span class="icon-male"></span></div>
							<div class="span1"><span class="icon-male"></span></div>
							<div class="span1"><span class="icon-male"></span></div>
							<div class="span2"></div> --->
							<!--- <span class="icon-male highlighted"></span>
							<span class="icon-male highlighted"></span>
							<span class="icon-male highlighted"></span>
							<span class="icon-male highlighted"></span>
							<span class="icon-male highlighted"></span>
							<span class="icon-male"></span>
							<span class="icon-male"></span>
							<span class="icon-male"></span>
							<span class="icon-male"></span>
							<span class="icon-male"></span> --->
						</div>
					</div>
					<!--- <div class="span6">
						<div id="q11AreaChart"></div>
					</div> --->
				</div>
				<h2>SENIOR ATTENDANCE </h2>
				<div id="q7Chart"></div>
				<h2>ATTENDANCE by RACE/ETHNICITY</h2>
				<div id="q12Chart"></div>
				
			</div>
			<div class="span5"></div>
		</div>
	</div>
</cfoutput>


<cfabort>

<!--- <cfdump var="#workshopEvaluations#"> --->
<!--- <cfdump var="#baseData#" expand="no" label="baseData">
<cfdump var="#siteWorkshops#" expand="no" label="Site Workshops"> --->
<!--- <cfquery name="getProgramYears" dbtype="query">
	select Program_Year, count(Workshop_ID) as Workshop_Count from siteWorkshops group by Program_Year order by Program_Year desc
</cfquery> --->
<!--- <cfdump var="#getProgramYears#"> --->
<!--- <cfoutput>
	<cfloop query="getProgramYears">
		<cfif Program_Year neq workshop.getProgram_Year()>
			<!--- <cfset baseData = evaluationGateway.report(programYear = Program_Year, siteIDs = workshop.getSite_ID())> --->
			<h3>#Program_Year# - #Workshop_Count#</h3>
			<!--- <cfdump var="#baseData#" expand="no" label="#Program_Year#"> --->
		</cfif>
	</cfloop>
</cfoutput> --->
<!--- <cfdump var="#baseData#" expand="no"> --->
<!--- <cfoutput>
<h3>How Did We Do?</h3>

<h4>Workshop Ratings</h4>
<cfloop index="r" from="1" to="#ArrayLen(baseData[1].answers)#">
	<cfset fs = Int(baseData[1].answers[r].response_percent) * 2 />
	<cfif fs gt 0>
	<font style="font-size: #fs#px;"><span class="icon-circle"></span></font>&nbsp;
	<cfelse>
		<font style="font-size: 4px;"><span class="icon-circle"></span></font>&nbsp;
	</cfif>
</cfloop> --->

<!--- <font style="font-size: 128px"><span class="icon-circle"></span></font>&nbsp;
<font style="font-size: 12px"><span class="icon-circle"></span></font>&nbsp;
<font style="font-size: 4px"><span class="icon-circle"></span></font> --->
<!--- <cfdump var="#baseData[1].answers#" expand="no" /> --->

<!--- <h4>Attendance by Gender</h4>
<cfdump var="#baseData[11].answers#" expand="no" />

<h4>Senior Attendance</h4>
<cfdump var="#baseData[7].answers#" expand="no" />

<h4>Attendance by Race/Ethnicity</h4>
<cfdump var="#baseData[12].answers#" expand="no" />

<h4>Parent Education Level</h4>
<cfdump var="#baseData[6].answers#" expand="no" />

<h4>Attended with Parents</h4>
<cfdump var="#baseData[10].answers#" expand="no" /> --->

<!--- <h4>FAFSA/Dream Act Applications</h4>
<cfdump var="#baseData[15].answers#" expand="no" /> --->

<!--- <h4>Cal Grant Applications</h4>
<cfdump var="#baseData[1].answers#" expand="no" />
</cfoutput> --->

<!--- <cfparam name="resetFilters" default="false">
<cfset isFiltered = false />
<cfset queryParams = StructNew() />

<cfif NOT IsDefined("client.howDidWeDo.programYear") or resetFilters>
<cfset client.howDidWeDo.programYear = request.currentProgramYear>
<cfelseif IsDefined("filterProgramYear")>
<cfset client.howDidWeDo.programYear = filterProgramYear>
</cfif>
<cfif client.howDidWeDo.programYear neq request.currentProgramYear>
<cfset isFiltered = true />
<cfset queryParams.programYear = client.howDidWeDo.programYear />
<cfelse>
<cfset queryParams.programYear = request.currentProgramYear />
</cfif>

<!--- <cfif NOT IsDefined("client.howDidWeDo.workshopIDs") or resetFilters>
<cfset client.howDidWeDo.workshopIDs = "All">
<cfelseif IsDefined("filterWorkshopIDs")>
<cfset client.howDidWeDo.workshopIDs = filterWorkshopIDs>
</cfif>
<cfif client.howDidWeDo.workshopIDs neq "All">
<cfset isFiltered = true />
<cfset queryParams.workshopIDs = client.howDidWeDo.workshopIDs />
</cfif> --->

<cfif NOT IsDefined("client.howDidWeDo.countyIDs") or resetFilters>
<cfset client.howDidWeDo.countyIDs = "All">
<cfelseif IsDefined("filterCountyIDs")>
<cfset client.howDidWeDo.countyIDs = filterCountyIDs>
</cfif>
<cfif client.howDidWeDo.countyIDs neq "All">
<cfset isFiltered = true />
<cfset queryParams.countyIDs = client.howDidWeDo.countyIDs />
<cfset filterCountyIDs = "All" />
</cfif>

<cfif NOT IsDefined("client.howDidWeDo.zipCodeIDs") or resetFilters>
<cfset client.howDidWeDo.zipCodeIDs = "All">
<cfelseif IsDefined("filterZipCodeIDs")>
<cfset client.howDidWeDo.zipCodeIDs = filterZipCodeIDs>
</cfif>
<cfif client.howDidWeDo.zipCodeIDs neq "All">
<cfset isFiltered = true />
<cfset queryParams.zipCodeIDs = client.howDidWeDo.zipCodeIDs />
<cfset filterZipCodeIDs = "All" />
</cfif>

<cfif NOT IsDefined("client.howDidWeDo.cityIDs") or resetFilters>
<cfset client.howDidWeDo.cityIDs = "All">
<cfelseif IsDefined("filterCityIDs")>
<cfset client.howDidWeDo.cityIDs = filterCityIDs>
</cfif>
<cfif client.howDidWeDo.cityIDs neq "All">
<cfset isFiltered = true />
<cfset queryParams.cityIDs = client.howDidWeDo.cityIDs />
<cfset filterCityIDs = "All" />
</cfif>

<cfif NOT IsDefined("client.howDidWeDo.districtIDs") or resetFilters>
<cfset client.howDidWeDo.districtIDs = "All">
<cfelseif IsDefined("filterDistrictIDs")>
<cfset client.howDidWeDo.districtIDs = filterDistrictIDs>
</cfif>
<cfif client.howDidWeDo.districtIDs neq "All">
<cfset isFiltered = true />
<cfset queryParams.districtIDs = client.howDidWeDo.districtIDs />
<cfset filterDistrictIDs = "All" />
</cfif>

<cfif NOT IsDefined("client.howDidWeDo.schoolIDs") or resetFilters>
<cfset client.howDidWeDo.schoolIDs = "All">
<cfelseif IsDefined("filterSchoolIDs")>
<cfset client.howDidWeDo.schoolIDs = filterSchoolIDs>
</cfif>
<cfif client.howDidWeDo.schoolIDs neq "All">
<cfset isFiltered = true />
<cfset queryParams.schoolIDs = client.howDidWeDo.schoolIDs />
<cfset filterSchoolIDs = "All" />
</cfif>

<cfif IsUserInRole("Super User")>
<cfif NOT IsDefined("client.howDidWeDo.regionIDs") or resetFilters>
<cfset client.howDidWeDo.regionIDs = "All">
<cfelseif IsDefined("filterRegionIDs")>
<cfset client.howDidWeDo.regionIDs = filterRegionIDs>
</cfif>
<cfelseif IsUserInRole("Regional Admin")>
<cfset client.howDidWeDo.regionIDs = request.authUser.regionID>
</cfif>
<cfif client.howDidWeDo.regionIDs neq "All">
<cfset isFiltered = true />
<cfset queryParams.regionIDs = client.howDidWeDo.regionIDs />
</cfif>

<cfif NOT IsDefined("client.howDidWeDo.organizationIDs") or resetFilters>
<cfset client.howDidWeDo.organizationIDs = "All">
<cfelseif IsDefined("filterOrganizationIDs")>
<cfset client.howDidWeDo.organizationIDs = filterOrganizationIDs>
</cfif>
<cfif client.howDidWeDo.organizationIDs neq "All">
<cfset isFiltered = true />
<cfset queryParams.organizationIDs = client.howDidWeDo.organizationIDs />
<cfset filterRegionIDs = "All" />
</cfif>

<cfwddx action="cfml2wddx" input="#queryParams#" output="client.howDidWeDo.queryParamsWDDX" /> --->

<!--- <cfscript>
//workshopGateway = new assets.calgrants.com.gateway.WorkshopGateway();
//workshops = workshopGateway.query(Program_Year = queryParams.programYear, Approved = 1, regionIDs = IIf(IsUserInRole("Regional Admin"), request.authUser.regionID, queryParams.regionIDs));
organizationGateway = new assets.calgrants.com.gateway.OrganizationGateway();
organizations = organizationGateway.query(regionIDs = IIf(IsUserInRole("Regional Admin"), request.authUser.regionID, ""), Organization_ID = IIf(IsUserInRole("Organizer") OR IsUserInRole("Site Contact"), request.authUser.organizationID, ""));
storedProcedureGateway = new assets.calgrants.com.gateway.StoredProcedureGateway();
regions = storedProcedureGateway.call("getDistinctRegions");
countyGateway = new assets.calgrants.com.gateway.CountyGateway();
counties = countyGateway.query();
evaluationGateway = new assets.calgrants.com.gateway.EvaluationGateway();
baseData = evaluationGateway.report(argumentCollection = queryParams);
if (ArrayLen(baseData) gt 0) {
evaluationCount = baseData[1].Response_Count + baseData[1].No_Response_Count;
} else {
evaluationCount = 0;
}
</cfscript>

<h3>How Did We Do<cfif isFiltered> <small><em>filtered</em></small></cfif></h3>

<cfif ArrayLen(baseData) gt 0>

<script type="text/javascript">

var parseQuestions = function(questions) {
	for (var q = 0; q < questions.length; q++) {
		questions[q].QUESTION_NUMBER = parseInt(questions[q].QUESTION_NUMBER);
		questions[q].RESPONSE_COUNT = parseInt(questions[q].RESPONSE_COUNT);
		questions[q].MULTI_RESPONSE_COUNT = parseInt(questions[q].MULTI_RESPONSE_COUNT);
		questions[q].NO_RESPONSE_COUNT = parseInt(questions[q].NO_RESPONSE_COUNT);
	}
	return questions;
}

var parseAnswers = function(answers) {
	for (var a = 0; a < answers.length; a++) {
		if (answers[a].ANSWER === true) {
			answers[a].ANSWER = "Yes ";
		} else if (answers[a].ANSWER === false) {
			answers[a].ANSWER = "No ";
		}
		answers[a].ANSWER_NUMBER = parseInt(answers[a].ANSWER_NUMBER);
		answers[a].RESPONSE_COUNT = parseInt(answers[a].RESPONSE_COUNT);
		answers[a].RESPONSE_PERCENT = parseFloat(answers[a].RESPONSE_PERCENT);
		//answers[a].RESPONSE_OTHER = answers[a].ANSWER_VALUES.toString();
		answers[a].EXPLODE = false;
	}
	return answers;
}

<cfoutput>
	var questions = #SerializeJSON(baseData)#;
</cfoutput>

var pieLabelTemplate = "#= dataItem.ANSWER# - #= dataItem.RESPONSE_PERCENT#%";
var pieLegendTemplate = "#= dataItem.ANSWER# - #= dataItem.RESPONSE_PERCENT#%";
//var pieTooltipTemplate = "#= dataItem.ANSWER# - #= dataItem.RESPONSE_COUNT#";
var pieTooltipTemplate = "#= dataItem.RESPONSE_COUNT# responses = #= dataItem.RESPONSE_PERCENT#%";
var barLabelTemplate = "#= dataItem.ANSWER# - #= dataItem.RESPONSE_PERCENT#%";
var barLegendTemplate = "#= text#";
var barTooltipTemplate = "#= dataItem.RESPONSE_COUNT# responses = #= dataItem.RESPONSE_PERCENT#%";
var labelFont = "12px Arial,Helvetical,sans-serif";
var legendFont = "12px Arial,Helvetical,sans-serif";
var tooltipFont = "12px Arial,Helvetical,sans-serif";

renderPieChart = function(q) {
	var question = questions[q-1];
	var answers = parseAnswers(question.ANSWERS);
	$("#q" + q + "Chart").kendoChart({
		theme: $(document).data("kendoSkin") || "blueopal",
		dataSource: answers,
		series: [{
			type: "pie",
			field: "RESPONSE_PERCENT",
			categoryField: "ANSWER",
			explodeField: "EXPLODE",
			labels: {
				visible: false,
				align: "circle",
				font: labelFont,
				template: pieLabelTemplate,
				distance: 0
			},
			padding: 0
		}],
		legend: {
			visible: false,
			position: "left",
			labels: {
				font: legendFont,
				template: pieLegendTemplate
			}
		},
		tooltip: {
			visible: true,
			font: tooltipFont,
			template: pieTooltipTemplate
		}
	})
}

renderBarChart = function(q) {
	var question = questions[q-1];
	var answers = parseAnswers(question.ANSWERS);
	$("#q" + q + "Chart").kendoChart({
		theme: $(document).data("kendoSkin") || "metro",
		dataSource: answers,
		plotArea: {
			margin: {
				right: 200
			}
		},
		series: [{
			type: "bar",
			field: "RESPONSE_PERCENT",
			categoryField: "ANSWER",
			labels: {visible: true, font: labelFont, template: barLabelTemplate, position: "outsideEnd"},
			missingValue: "zero",
			gap: 0.4,
			spacing: 0.2,
			markers: {visible: true, border: {width: 2, size: 6}},
			padding: 50
		}],
		valueAxis: {
			title: {visible: false, text: "valueAxis"},
			labels: {template: "#= value#%"},
			majorGridLines: {visible: true, color: "gray"},
			majorTicks: {visible: true, color: "gray"},
			minorGridLines: {visible: false, color: "silver"},
			minorTicks: {visible: false, color: "silver"},
			plotBands: [{
				from: 49,
				to: 51,
				color: "gray",
				opacity: 0.3
			}]
		},
		categoryAxis: {
			title: {visible: false, text: "categoryAxis"},
			majorGridLines: {visible: false},
			majorTicks: {visible: false}
		},
		legend: {
			visible: false,
			position: "left",
			labels: {font: legendFont, template: barLegendTemplate}
		},
		tooltip: {
			visible: true,
			font: tooltipFont,
			template: barTooltipTemplate
		}
	})
}

initialize = function() {
	// Using spreadsheet as underlying table.  Change to Fusion Tables.
	var query = new google.visualization.Query('https://spreadsheets.google.com/pub?key=pCQbetd-CptF0r8qmCOlZGg');
	query.send(draw);
}

/*draw = function(response) {
	if (response.isError()) {
		alert('Error in query');
	}
	
	var ticketsData = response.getDataTable();
	var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
	chart.draw(ticketsData, {'isStacked': true, 'legend': 'bottom',	'vAxis': {'title': 'Number of tickets'}});

	var geoData = new google.visualization.DataTable();
	geoData.addColumn('string', 'City');
	geoData.addColumn('string', 'Name');
	geoData.addColumn('boolean', 'Food');
	geoData.addRows(3);
	geoData.setCell(0, 0, 'London');
	geoData.setCell(1, 0, 'Paris');
	geoData.setCell(2, 0, 'Moscow');
	geoData.setCell(0, 1, 'Cinematics London');
	geoData.setCell(1, 1, 'Cinematics Paris');
	geoData.setCell(2, 1, 'Cinematics Moscow');
	geoData.setCell(0, 2, true);
	geoData.setCell(1, 2, true);
	geoData.setCell(2, 2, false);

	var geoView = new google.visualization.DataView(geoData);
	geoView.setColumns([0, 1]);
	
	var table = new google.visualization.Table(document.getElementById('table_div'));
	table.draw(geoData, {showRowNumber: false});
	
	var map = new google.visualization.Map(document.getElementById('map_div'));
	map.draw(geoView, {showTip: true});

	// Set a 'select' event listener for the table.
	// When the table is selected,
	// we set the selection on the map.
	google.visualization.events.addListener(table, 'select',
		function() {
			map.setSelection(table.getSelection());
		}
	);
	
	// Set a 'select' event listener for the map.
	// When the map is selected,
	// we set the selection on the table.
	google.visualization.events.addListener(map, 'select',
		function() {
			table.setSelection(map.getSelection());
		}
	);
};

google.load('visualization', '1', {'packages': ['table', 'map', 'corechart']});
	
google.setOnLoadCallback(initialize);*/

$(function() {
	var pieCharts = "1,2,3,4,5,7,10,11,12,13,15,17,19";
	var barCharts = "6,9,14,16,18";
	var pieChartsArray = pieCharts.split(",");
	var barChartsArray = barCharts.split(",");
	if (pieChartsArray.length > 0) {
		for (var q = 0; q < pieChartsArray.length; q++) {
			renderPieChart(pieChartsArray[q]);
		}
	}
	if (barChartsArray.length > 0) {
		for (var q = 0; q < barChartsArray.length; q++) {
			renderBarChart(barChartsArray[q]);
		}
	}
});
//-->
</script>

<style type="text/css">
.k-chart {
	width: 200px;
	height: 150px;
}
</style>

<cfoutput>

<div class="row-fluid" style="margin-bottom: 10px;">
	<div class="span12">
		<a id="filterLink" href="##" class="btn" onclick="toggleFilter('filter')">Show filters</a>
		<span class="pull-right"><strong>Count:</strong> #evaluationCount#</span>
	</div>
</div>

<div id="filter" class="row-fluid" style="display: none;">
	<div class="span12">
		<!--- <h4>Data Controls</h4> --->
		<div class="well well-framed">
			<cfform name="evaluationsForm" id="evaluationsForm" action="#script_name#" method="post">
				<cfinput type="hidden" name="view" value="#view#">
				<div class="row-fluid">
					<div class="span4">
						<table cellpadding="6" border="0">
							<tr valign="top">
								<td>
									<label>Program Year</label>
									<cfselect name="filterProgramYear" size="1" multiple="false" required="yes" message="Program Year filter is required">
										<cfloop index="y" from="2012" to="#ListFirst(application.currentProgramYear, '-')#">
											<cfset py = "#y#-" & y+1>
											<option value="#py#"<cfif client.howDidWeDo.programYear eq py> selected</cfif>>#py#</option>
										</cfloop>
									</cfselect>
								</td>
							</tr>
							<tr>
								<cfif IsUserInRole("Super User")>
									<td>
										<label>Region</label>
										<cfselect name="filterRegionIDs" size="1" multiple="false" required="yes" message="Region filter is required">
											<option value="All"<cfif client.howDidWeDo.regionIDs eq "All"> selected</cfif>>All</option>
											<cfloop query="regions">
												<option value="#Region_ID#"<cfif ListFind(client.howDidWeDo.regionIDs, Region_ID)> selected</cfif>>#Region_ID#</option>
											</cfloop>
										</cfselect>
									</td>
								</cfif>
							</tr>
							<tr>
								<td>
									<label>County</label>
									<cfselect name="filterCountyIDs" size="1" multiple="false" required="yes" message="County filter is required">
										<option value="All"<cfif client.howDidWeDo.countyIDs eq "All"> selected</cfif>>All</option>
										<cfloop query="counties">
											<option value="#County_ID#"<cfif ListFind(client.howDidWeDo.countyIDs, County_ID)> selected</cfif>>#County#</option>
										</cfloop>
									</cfselect>
								</td>
							</tr>
							<tr>
								<td>
									<label>School District</label>
									<cfselect name="filterDistrictIDs" size="1" multiple="false" required="yes" message="School District filter is required">
										<option value="All">All</option>
										<option>Coming soon</option>
									</cfselect>
								</td>
							</tr>
							<tr>
								<td>
									<label>School</label>
									<cfselect name="filterSchoolIDs" size="1" multiple="false" required="yes" message="School filter is required">
										<option value="All">All</option>
										<option>Coming soon</option>
									</cfselect>
								</td>
								<!--- <td>
									<label>Organizations</label>
									<cfselect name="filterOrganizationIDs" size="7" multiple="true" required="yes" message="Organization filter is required" style="width: auto;">
										<option value="All"<cfif client.howDidWeDo.organizationIDs eq "All"> selected</cfif>>All</option>
										<cfloop query="organizations">
											<option value="#Organization_ID#"<cfif ListFind(client.howDidWeDo.organizationIDs, Organization_ID)> selected</cfif>>#Organization# - #City#</option>
										</cfloop>
									</cfselect>
								</td>
								<td>
									<!--- <label>Follow Up</label>
									<cfif client.students.programYear neq "All" and client.students.programYear gte "2012-2013">
										<cfselect name="filterFollowUp" size="1" multiple="false" required="yes" message="Follow Up filter is required">
											<option value="All"<cfif client.students.followUp eq "All"> selected</cfif>>All</option>
											<option value="Yes"<cfif client.students.followUp eq "Yes"> selected</cfif>>Yes</option>
											<option value="No"<cfif client.students.followUp eq "No"> selected</cfif>>No</option>
										</cfselect>
									<cfelse>
										<span class="muted"><small>Not available as filtered</small></span>
									</cfif> --->
								</td>
								<td>
									<!--- <label>Follow Up Status</label>
									<cfif client.students.programYear neq "All" and client.students.programYear gte "2012-2013">
										<cfselect name="filterFollowUpStatus" size="1" multiple="false" required="yes" message="Follow Up Status filter is required">
											<option value="All"<cfif client.students.followUpStatus eq "All"> selected</cfif>>All</option>
											<option value="Complete"<cfif client.students.followUpStatus eq "Complete"> selected</cfif>>Complete</option>
											<option value="Not Complete"<cfif client.students.followUpStatus eq "Not Complete"> selected</cfif>>Not Complete</option>
										</cfselect>
									<cfelse>
										<span class="muted"><small>Not available as filtered</small></span>
									</cfif> --->
								</td> --->
							</tr>
						</table>
					</div>
					<div class="span8">
						<table cellpadding="6" border="0">
							<tr>
								<td colspan="2">
									<label>Dimension 1</label>
									<cfselect name="dimension1" size="1" multiple="false" required="yes" message="Dimention 1 is required" style="width: auto;">
										<option value="1">FAFSAs submitted and completed</option>
										<option value="2">E1 FAFSAs submitted and completed</option>
										<option value="3">Cal Grant GPAs submitted by March 2 deadline</option>
										<option value="4">Entitlement Cal Grant applications and awards offered</option>
										<option value="5">Entitlement E1 Cal Grant applications and awards offered</option>
										<option value="6">E1 Enrollment</option>
										<option value="7">E1 Cal Grant Champion schools</option>
										<option value="7">E1 Cal Grant Champion districts</option>
										<option value="8">Total state and federal funds...</option>
										<cfloop index="q" from="1" to="#ArrayLen(baseData)#">
											<option value="#q#"<cfif q eq 11> selected</cfif>>#baseData[q].Question#</option>
										</cfloop>
									</cfselect>
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<label>Dimension 2</label>
									<cfselect name="dimension2" size="1" multiple="false" required="yes" message="Dimention 2 is required" style="width: auto;">
										<option value="None">None</option>
										<option value="1">FAFSAs submitted and completed</option>
										<option value="2">E1 FAFSAs submitted and completed</option>
										<option value="3">Cal Grant GPAs submitted by March 2 deadline</option>
										<option value="4">Entitlement Cal Grant applications and awards offered</option>
										<option value="5">Entitlement E1 Cal Grant applications and awards offered</option>
										<option value="6">E1 Enrollment</option>
										<option value="7">E1 Cal Grant Champion schools</option>
										<option value="7">E1 Cal Grant Champion districts</option>
										<option value="8">Total state and federal funds...</option>
										<cfloop index="q" from="1" to="#ArrayLen(baseData)#">
											<option value="#q#"<cfif q eq 12> selected</cfif>>#baseData[q].Question#</option>
										</cfloop>
									</cfselect>
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<label>Dimension 3</label>
									<cfselect name="dimension3" size="1" multiple="false" required="yes" message="Dimention 2 is required" style="width: auto;">
										<option value="None">None</option>
										<option value="1">FAFSAs submitted and completed</option>
										<option value="2">E1 FAFSAs submitted and completed</option>
										<option value="3">Cal Grant GPAs submitted by March 2 deadline</option>
										<option value="4">Entitlement Cal Grant applications and awards offered</option>
										<option value="5">Entitlement E1 Cal Grant applications and awards offered</option>
										<option value="6">E1 Enrollment</option>
										<option value="7">E1 Cal Grant Champion schools</option>
										<option value="7">E1 Cal Grant Champion districts</option>
										<option value="8">Total state and federal funds...</option>
										<cfloop index="q" from="1" to="#ArrayLen(baseData)#">
											<option value="#q#">#baseData[q].Question#</option>
										</cfloop>
									</cfselect>
								</td>
							</tr>
						</table>
					</div>
				</div>
				<div class="row-fluid">
					<div class="span12">
						<button type="submit" class="btn btn-primary">Apply</button><!---  <a href="#script_name#?view=exitSurveys&resetFilters=true" class="btn">Clear</a> --->
					</div>
				</div>
			</cfform>
		</div>
	</div>
</div>
<!--- <div id="table_div" class="clearfix" style="width: 100%; height: 400px;"></div>
<div id="chart_div" class="clearfix" style="width: 100%; height: 400px;"></div> --->
<!--- <div class="accordion" id="esAccordian">
	<cfloop index="q" from="1" to="#ArrayLen(baseData)#">
		<cfset totalExitSurveys = baseData[q].Response_Count + baseData[q].No_Response_Count />
		<cfset noResponsePercent = baseData[q].No_Response_Count / totalExitSurveys * 100 />
		<cfset multiResponsePercent = baseData[q].Multi_Response_Count / totalExitSurveys * 100 />
		<div class="accordion-group">
			<div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="##esAccordian" href="##p#q#">#q#. #baseData[q].Question#</a> </div>
			<div id="p#q#" class="accordion-body collapse<cfif q eq 1> in</cfif>">
				<div class="accordion-inner">
					<cfif q eq 8>
						Data can not be charted.
					<cfelse>
						<ul class="nav nav-pills">
							<li class="active"><a href="##table#q#" data-toggle="pill">Table</a></li>
							<li><a href="##chart#q#" data-toggle="pill">Chart</a></li>
						</ul>
						<div class="tab-content">
							<div class="tab-pane active" id="table#q#">
								<table class="table table-hover table-bordered">
									<thead>
										<th>Answer</th>
										<th>Count</th>
										<th>Percent</th>
									</thead>
									<tbody>
										<cfloop index="a" from="1" to="#ArrayLen(baseData[q].Answers)#">
											<tr>
												<td>#baseData[q].Answers[a].Answer#</td>
												<td>#baseData[q].Answers[a].Response_Count#</td>
												<td>#baseData[q].Answers[a].Response_Percent#%</td>
											</tr>
										</cfloop>
										<tr>
											<td>Did not respond</td>
											<td>#baseData[q].No_Response_Count#</td>
											<td>#DecimalFormat(noResponsePercent)#%</td>
										</tr>
										<cfif baseData[q].Question_Type eq "Multiple select">
											<tr>
												<td>Multiple responses</td>
												<td>#baseData[q].Multi_Response_Count#</td>
												<td>#DecimalFormat(multiResponsePercent)#%</td>
											</tr>
										</cfif>
									</tbody>
								</table>
							</div>
							<div class="tab-pane" id="chart#q#">
								<div id="q#q#Chart"></div>
							</div>
						</div>
					</cfif>
				</div>
			</div>
		</div>
	</cfloop>
</div> --->
<div class="row-fluid">
	<div class="span6">		
		<cfset dim = 1>
		<cfloop index="q" from="11" to="12">
			<cfset totalExitSurveys = baseData[q].Response_Count + baseData[q].No_Response_Count />
			<cfset noResponsePercent = baseData[q].No_Response_Count / totalExitSurveys * 100 />
			<cfset multiResponsePercent = baseData[q].Multi_Response_Count / totalExitSurveys * 100 />
			
			<h4>Dimension #dim# - #baseData[q].Question#</h4>
			
			<div class="row-fluid">
				<div class="span8">
					<table class="table table-hover table-bordered">
						<thead>
							<th>Answer</th>
							<th>Count</th>
							<th>Percent</th>
						</thead>
						<tbody>
							<cfloop index="a" from="1" to="#ArrayLen(baseData[q].Answers)#">
								<tr>
									<td>#baseData[q].Answers[a].Answer#</td>
									<td>#baseData[q].Answers[a].Response_Count#</td>
									<td>#baseData[q].Answers[a].Response_Percent#%</td>
								</tr>
							</cfloop>
							<tr>
								<td>Did not respond</td>
								<td>#baseData[q].No_Response_Count#</td>
								<td>#DecimalFormat(noResponsePercent)#%</td>
							</tr>
							<cfif baseData[q].Question_Type eq "Multiple select">
								<tr>
									<td>Multiple responses</td>
									<td>#baseData[q].Multi_Response_Count#</td>
									<td>#DecimalFormat(multiResponsePercent)#%</td>
								</tr>
							</cfif>
						</tbody>
					</table>
				</div>
				<div class="span4">
					<div id="q#q#Chart"></div>
				</div>
			</div>
			<cfif dim eq 2>
				<h4>Dimension 1 x Dimension 2</h4>
				<div class="row-fluid">
					<div class="span8">
						<table class="table table-hover table-bordered">
						<thead>
							<th>D1 Answer</th>
							<th>D2 Answer</th>
							<th>Count</th>
							<th>Percent</th>
						</thead>
						<tbody>
							
								<tr>
									<td>Male</td>
									<td>American Indian or Alaskan Native</td>
									<td>46</td>
									<td>1.96%</td>
								</tr>
								<tr>
									<td>Female</td>
									<td>American Indian or Alaskan Native</td>
									<td>46</td>
									<td>1.96%</td>
								</tr>
								
								<tr>
									<td>Male</td>
									<td>Asian</td>
									<td>112</td>
									<td>4.77%</td>
								</tr>
								<tr>
									<td>Female</td>
									<td>Asian</td>
									<td>112</td>
									<td>4.77%</td>
								</tr>
							
								<tr>
									<td>Male</td>
									<td>Black/African American</td>
									<td>104</td>
									<td>4.43%</td>
								</tr>
								<tr>
									<td>Female</td>
									<td>Black/African American</td>
									<td>104</td>
									<td>4.43%</td>
								</tr>
							
								<tr>
									<td>Male</td>
									<td>Hispanic/Latino</td>
									<td>1779</td>
									<td>75.73%</td>
								</tr>
								<tr>
									<td>Female</td>
									<td>Hispanic/Latino</td>
									<td>1779</td>
									<td>75.73%</td>
								</tr>
							
								<tr>
									<td>Male</td>
									<td>Native Hawaiian or other Pacific Islander</td>
									<td>23</td>
									<td>0.98%</td>
								</tr>
								<tr>
									<td>Female</td>
									<td>Native Hawaiian or other Pacific Islander</td>
									<td>23</td>
									<td>0.98%</td>
								</tr>
							
								<tr>
									<td>Male</td>
									<td>White</td>
									<td>423</td>
									<td>18.01%</td>
								</tr>
								<tr>
									<td>Female</td>
									<td>White</td>
									<td>423</td>
									<td>18.01%</td>
								</tr>
							
								<tr>
									<td>Male</td>
									<td>Other</td>
									<td>37</td>
									<td>1.58%</td>
								</tr>
								<tr>
									<td>Female</td>
									<td>Other</td>
									<td>37</td>
									<td>1.58%</td>
								</tr>
							
								<tr>
									<td>Male</td>
									<td>Decline to answer</td>
									<td>29</td>
									<td>1.23%</td>
								</tr>
								<tr>
									<td>Female</td>
									<td>Decline to answer</td>
									<td>29</td>
									<td>1.23%</td>
								</tr>
							
							<tr>
								<td>Male</td>
								<td>Did not respond</td>
								<td>27</td>
								<td>1.14%</td>
							</tr>
							<tr>
								<td>Female</td>
								<td>Did not respond</td>
								<td>27</td>
								<td>1.14%</td>
							</tr>
							
								<tr>
									<td>Male</td>
									<td>Multiple responses</td>
									<td>177</td>
									<td>7.45%</td>
								</tr>
								<tr>
									<td>Female</td>
									<td>Multiple responses</td>
									<td>177</td>
									<td>7.45%</td>
								</tr>
							
						</tbody>
					</table>

					</div>
					<div class="span4">
						<div class="well well-framed">
							Chart
						</div>
					</div>
				</div>
			</cfif>
			<cfset dim++ />
		</cfloop>
		
	</div>
	<div class="span6">
	
		<ul class="nav nav-tabs">
			<li class="active"><a href="##districtMap" data-toggle="tab">Districts</a></li>
			<li><a href="##schoolMap" data-toggle="tab">Schools</a></li>
			<!--- <li><a href="##countyMap">Counties</a></li> --->
		</ul>
		<div class="tab-content">
			<div class="tab-pane active" id="districtMap">
				<iframe 	width="100%" 
							height="800" 
							frameborder="0" 
							scrolling="no" 
							marginheight="0" 
							marginwidth="0" 
							src="https://www.google.com/fusiontables/embedviz?q=select+col2+from+1duB6hyn5n1ukEWBrhbyCK0U1T_ufWC0m26E0QKA&amp;viz=MAP&amp;h=false&amp;lat=37.41896824258246&amp;lng=-119.30660499999999&amp;t=1&amp;z=6&amp;l=col2"></iframe>
						
			</div>		
			<div class="tab-pane" id="schoolMap">		
				<iframe 	width="100%" 
							height="800" 
							frameborder="0" 
							scrolling="no" 
							marginheight="0" 
							marginwidth="0" 
							src="https://www.google.com/fusiontables/embedviz?q=select+col2+from+1z9zka5upPaG2QDp53pUZPLvxdsrMbxVTMaxEn34&amp;viz=MAP&amp;h=false&amp;lat=37.41896824258246&amp;lng=-119.30660499999999&amp;t=1&amp;z=6&amp;l=col2"></iframe>
			</div>			
			<!--- <div id="map_div" style="width: 100%; height: 100%;"></div> --->
		</div>
	</div>
</div>

</cfoutput>
<!---<iframe width="500" height="300" scrolling="no" frameborder="no" src="https://www.google.com/fusiontables/embedviz?q=select+col2+from+1z9zka5upPaG2QDp53pUZPLvxdsrMbxVTMaxEn34&amp;viz=MAP&amp;h=false&amp;lat=37.660996516345364&amp;lng=-117.67721371049997&amp;t=1&amp;z=6&amp;l=col2"></iframe> <iframe width="500" height="300" scrolling="no" frameborder="no" src="https://www.google.com/fusiontables/embedviz?q=select+col2+from+1duB6hyn5n1ukEWBrhbyCK0U1T_ufWC0m26E0QKA&amp;viz=MAP&amp;h=false&amp;lat=37.41896824258246&amp;lng=-119.30660499999999&amp;t=1&amp;z=6&amp;l=col2"></iframe>
// School Districts
https://www.google.com/fusiontables/DataSource?snapid=S107070198FJ
// Public schools
https://www.google.com/fusiontables/DataSource?snapid=S1070801g4Pc --->
<cfelse>

<p class="noRecords">No data</p>

<script type="text/javascript" language="javascript">
<!--
$(function() {
	$("#filter").show();
});
// -->
</script>

</cfif> --->